import socket

socket_server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
socket_server.bind(("127.0.0.1", 8888))
print("服务端已经启动")

while True:
    data, client = socket_server.recvfrom(1024)
    print("服务端接收到的数据", data.decode("utf-8"))
    socket_server.sendto("你好，客户端".encode("utf-8"), client)



